home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / eiffel / smalleif.97 / se.t / SmallEiffel / lib_test / test_is_equal.e < prev    next >
Encoding:
Text File  |  1996-05-02  |  1.2 KB  |  65 lines

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_IS_EQUAL
  5.  
  6. creation {ANY}
  7.    make
  8.    
  9. feature {ANY}
  10.    
  11.    make is
  12.       local
  13.      animal1, animal2: ANIMAL;
  14.      p1, p2: POINT;
  15.      t1, t2: TRIANGLE;
  16.      any1, any2: ANY;
  17.      cp1, cp2: COLORED_POINT;
  18.       do
  19.      is_true(("foo").is_equal("foo"));
  20.      is_true(not ("bar").is_equal("foo"));
  21.      is_true(not ("foo").is_equal(""));
  22.      
  23.      !DOG!animal1;
  24.      !CAT!animal1;
  25.      !CAT!animal2;
  26.      is_true(animal1.is_equal(animal2));
  27.      
  28.      !!p1.make(1.5,2.5);
  29.      !!p2.make(1.5,2.5);
  30.      is_true(p1.is_equal(p2));
  31.      is_true(p2.is_equal(p1));
  32.      
  33.      any1 := p1;
  34.      any2 := p2;
  35.      is_true(any1.is_equal(any2));
  36.      is_true(any2.is_equal(any1));
  37.      
  38.      !!cp1.make(1.5,2.5,"red");
  39.      !!cp2.make(1.5,2.5,"red");
  40.      is_true(not cp1.is_equal(cp2));
  41.      
  42.      any1 := cp1;
  43.      any2 := cp1;
  44.      is_true(any1.is_equal(any2));
  45.      any2 := cp2;
  46.      is_true(not any1.is_equal(any2));
  47.      
  48.       end;
  49.    
  50.    is_true(b: BOOLEAN) is
  51.       do
  52.      cpt := cpt + 1;
  53.      if not b then
  54.         std_output.put_string("TEST_IS_EQUAL: ERROR Test # ");
  55.         std_output.put_integer(cpt);
  56.         std_output.put_string("%N");
  57.      else
  58.         -- std_output.put_string("Yes %N");
  59.      end;
  60.       end;
  61.    
  62.    cpt: INTEGER;
  63.    
  64. end -- TEST_IS_EQUAL
  65.